public class PrintDigit {
    public static void Print(int n) {
        if (n < 10) {
            System.out.print(n + " ");
        }
        else {
            Print(n/10);
            System.out.print(n%10+" ");
        }
    }


    public static void main(String[] args) {
        Print(4223);
    }
}
